package ru.cybertek.dao;

import java.util.List;

import ru.cybertek.domain.Account;
import ru.cybertek.domain.Person;

/**
 * @author Dmitry Demyankov
 * @version $Revision: 10 $
 * 
 *         (C) Copyright 2009 CyberTek Ltd. All rights reserved.
 */
public interface PersonDao
{
    /**
     * Returns list of persons.
     * 
     * @return List of {@link ru.cybertek.domain.Person} objects.
     */
    public List<Person> getPersonList();

    /**
     * Returns {@link ru.cybertek.domain.Person} for given id.
     * 
     * @param id
     *            Person id.
     * 
     * @return {@link ru.cybertek.domain.Person} object.
     */
    public Person getPerson(Integer id);

    /**
     * Saves new {@link ru.cybertek.domain.Person} in database or updates
     * existing Person.
     * 
     * @param person
     *            {@link ru.cybertek.domain.Person} object to save or update.
     */
    public void savePerson(Person person);

    /**
     * Deletes {@link ru.cybertek.domain.Person} from database.
     * 
     * @param person
     *            {@link ru.cybertek.domain.Person} to delete.
     */
    public void deletePerson(Person person);

    /**
     * Returns list of {@link ru.cybertek.domain.Person} accounts.
     * 
     * @param personId
     *            Id of {@link ru.cybertek.domain.Person}.
     * 
     * @return List of {@link ru.cybertek.domain.Account} for given Person.
     */
    public List<Account> getPersonAccounts(Integer personId);
}
